Fix leak I introdued in new "obvious" code yesterday. Brace ourselves for
authorrobertlipe <robertlipe@gmail.com>
Thu, 3 Oct 2013 00:43:34 +0000 (00:43 +0000)
committerrobertlipe <robertlipe@gmail.com>
Thu, 3 Oct 2013 00:43:34 +0000 (00:43 +0000)
more of these soon...

gpsbabel/defs.h
gpsbabel/mkshort.cc

index 75d50d8c3afaa1ee63eef82ec19eb0f8433da6c9..98cabc210beeaf6120d55de3e2dfbce2c49397a3 100644 (file)
@@ -773,7 +773,7 @@ typedef mkshort_handle_imp* short_handle;
 
 #ifndef DEBUG_MEM
 char* mkshort(short_handle,  const char*);
-char* mkshort(short_handle,  const QString&);
+QString mkshort(short_handle,  const QString&);
 short_handle mkshort_new_handle(void);
 #else
 char* MKSHORT(short_handle,  const char*, DEBUG_PARAMS);
index cd1a8aa9d5e3a054ae991e6885875062e2056685..7bd919e8bdd5c2a6db324efb21ae669ed3e3c378 100644 (file)
@@ -572,10 +572,13 @@ mkshort(short_handle h, const char* istring)
   return ostring;
 }
 
-char *
+QString
 mkshort(short_handle h, const QString& istring)
 {
-  return mkshort(h, CSTR(istring));
+  char *t =  mkshort(h, CSTR(istring));
+  QString r(t);
+  xfree(t);
+  return r;
 }
 
 /*